#include <iostream>
#include <memory.h>
#include <string>

class Prototype
{
public:
    virtual ~Prototype(){};
    virtual Prototype *Clone() const = 0;
    virtual void show() = 0;

protected:
    Prototype() {}
};

class ConcretePrototype : public Prototype
{
private:

public:
    ConcretePrototype(){};
    ConcretePrototype(const ConcretePrototype &cp)
    {
        std::cout << "ConcretePrototype copy ..." << std::endl;
    }
    ~ConcretePrototype(){};
    Prototype *Clone() const
    {
        return new ConcretePrototype(*this);
    }

    void show()
    {
        std::cout << "test show ptr= " << this << std::endl;
    }
};

int main()
{

    Prototype *p = new ConcretePrototype();
    Prototype *p1 = p->Clone();
    p->show();
    p1->show();

    delete p;
    delete p1;

    return 0;
}